> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/jaypopat/cf_ai_duet/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get started with Duet in under a minute

Get up and running with your first Duet pairing session. This guide walks you through connecting via SSH, creating or joining a room, and starting your collaborative session.

## Connect via SSH

The fastest way to try Duet is to connect to the hosted version:

```bash theme={null}
ssh <username>@duet.jaypopat.me
```

Replace `<username>` with any username you'd like to use in the session (e.g., `alice`, `bob`). Your username will be visible to other users in the room.

<Note>
  If you don't specify a username, you'll be assigned the default username "guest".
</Note>

## Create or join a room

Once connected, you'll see the launch screen with two options:

<Steps>
  <Step title="Create a new room">
    Press `c` or `C` to create a new room.

    You can optionally enter a description for your room (e.g., "React debugging session"). This description will be used to name the workspace directory.

    Press `Enter` to create the room. You'll see a shareable **room ID** (UUID format) that others can use to join.
  </Step>

  <Step title="Join an existing room">
    Press `J` (capital J) to join an existing room.

    Enter the room ID shared by the host and press `Enter`.

    You'll join the session and see the existing terminal history and any ongoing AI conversations.
  </Step>
</Steps>

<Info>
  Room IDs are UUIDs (e.g., `f47ac10b-58cc-4372-a567-0e02b2c3d479`). Share this ID with collaborators to let them join your session.
</Info>

## Your first pairing session

After creating or joining a room, you'll enter the main collaboration interface:

### Interface overview

The screen is divided into three sections:

* **Left sidebar** - Shows your username, room ID, connected users, and keyboard shortcuts
* **Center terminal** - Shared terminal where all users can type and see output in real-time
* **Right AI sidebar** - (Optional) AI conversation panel, toggle with `Ctrl+A`

### Using the shared terminal

Everything you type goes to the shared terminal and is visible to all users:

```bash theme={null}
# All users see this in real-time
echo "Hello from Duet!"
ls -la
nvim index.js  # Neovim is pre-installed
```

<Tip>
  The terminal comes with Neovim and Node.js pre-installed, perfect for pair programming on code.
</Tip>

### Keyboard shortcuts

<AccordionGroup>
  <Accordion title="Essential shortcuts">
    * `Ctrl+G` - Ask the AI assistant a question
    * `Ctrl+R` - Run a command in the sandbox
    * `Ctrl+A` - Toggle AI sidebar visibility
    * `Ctrl+L` - Leave room and return to launch screen
  </Accordion>

  <Accordion title="AI sidebar navigation">
    * `Ctrl+J` - Scroll AI conversation down
    * `Ctrl+K` - Scroll AI conversation up
  </Accordion>

  <Accordion title="Terminal navigation">
    All standard terminal shortcuts work: arrow keys, `Ctrl+C`, `Tab`, etc.
  </Accordion>
</AccordionGroup>

## Try the AI assistant

Press `Ctrl+G` to activate AI mode and ask a question:

```
How do I create a React component?
```

The AI (powered by Cloudflare's Llama 3 8B model) will respond in the sidebar. It can also run commands automatically using `<run>` tags:

```
Show me the contents of this directory
```

The AI might respond with a command like:

```
Let me check the directory contents
<run>ls -la</run>
```

The command will execute automatically and the output will appear in the AI conversation.

<Warning>
  AI features require a Cloudflare Worker to be configured. If you see "AI not configured", the server administrator needs to set the `-worker` flag. See [Self-hosting](/deployment/self-hosting) for details.
</Warning>

## Run sandbox commands

Press `Ctrl+R` to run a command directly in the Cloudflare sandbox:

```bash theme={null}
npm --version
```

The output will appear as a toast notification at the bottom of the screen. Sandbox commands run in isolation from the shared terminal.

## Leave the session

When you're done:

1. Press `Ctrl+L` to leave the room
2. You'll return to the launch screen
3. The room will be cleaned up automatically when the last user leaves

## Run Duet locally

Want to run your own instance?

<CodeGroup>
  ```bash Development mode theme={null}
  make dev
  ```

  ```bash Docker theme={null}
  docker build -t duet .
  docker run -p 2222:2222 duet
  ```
</CodeGroup>

Then connect to your local instance:

```bash theme={null}
ssh <username>@localhost -p 2222
```

See [Self-hosting](/deployment/self-hosting) for complete deployment instructions.

## Next steps

<CardGroup cols={2}>
  <Card title="Core features" icon="star" href="/features/pairing-sessions">
    Learn about pairing sessions, terminal sharing, and AI features
  </Card>

  <Card title="Keyboard shortcuts" icon="keyboard" href="/guides/terminal-commands">
    Master all keyboard shortcuts and terminal commands
  </Card>

  <Card title="AI interaction" icon="robot" href="/guides/ai-interaction">
    Deep dive into AI assistant capabilities
  </Card>

  <Card title="Deploy your own" icon="server" href="/deployment/self-hosting">
    Self-host Duet with your own Cloudflare Worker
  </Card>
</CardGroup>
